package ex.com.jm.food.service.impl;

import java.util.List;

import ex.com.jm.food.dao.AdminUserDao;
import ex.com.jm.food.entity.User;
import ex.com.jm.food.service.AdminUserService;

public class AdminUserServiceImpl implements AdminUserService {

	private AdminUserDao adminUserDao;
	public AdminUserDao getAdminUserDao() {
		return adminUserDao;
	}

	public void setAdminUserDao(AdminUserDao adminUserDao) {
		this.adminUserDao = adminUserDao;
	}

	@Override
	public List<User> getUsers(int initPage, int pageRow, String name,
			String s_date, String e_date, Integer type, String sort,
			String order) {
		// TODO Auto-generated method stub
		return this.getAdminUserDao().getUsers(initPage, pageRow, name, s_date, e_date, type, sort, order);
	}

	@Override
	public int userCount(String name, String s_date, String e_date, Integer type) {
		// TODO Auto-generated method stub
		return this.getAdminUserDao().userCount(name, s_date, e_date, type);
	}

	@Override
	public User getUser(String id) {
		// TODO Auto-generated method stub
		return this.getAdminUserDao().getUser(id);
	}

	@Override
	public Object saveUser(User user) {
		// TODO Auto-generated method stub
		return this.getAdminUserDao().saveUser(user);
	}

	@Override
	public void updateUser(User user) {
		// TODO Auto-generated method stub
       this.getAdminUserDao().updateUser(user);
	}

	@Override
	public boolean updateType(Integer type,String id) {
		// TODO Auto-generated method stub
		return this.getAdminUserDao().updateType(type,id);
	}

	@Override
	public void delUser(String id) {
		// TODO Auto-generated method stub
        this.getAdminUserDao().delUser(id);
	}

	@Override
	public User checkName(String name) {
		// TODO Auto-generated method stub
		return this.getAdminUserDao().checkName(name);
	}

	@Override
	public User checkEmail(String email) {
		// TODO Auto-generated method stub
		return this.getAdminUserDao().checkEmail(email);
	}

}
